package com.ai5suoai.ams.repository;

import com.ai5suoai.ams.entity.Authority;

import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author chenzhenjia
 * @since 16/4/21
 */
@Repository
public interface AuthorityRepository extends MongoRepository<Authority, String> {

    Authority findByName(String name);

    @Query("{'name':{$in:?0}}")
    List<Authority> findByName(String[] name);
}
